<?php


if (!function_exists('makeResponse')) {
    function makeResponse($data = [], $msg = '', $code = 0)
    {
        return compact('code', 'msg', 'data');
    }
}
if (!function_exists('handleData')) {
    function handleData($data)
    {
        $valueStr = '';
        foreach ($data as $v) {
            $valueStr .= "('" . $v['number_plate'] . "','" . $v['community_id'] . "'),";//循环拼接添加数据
        }
        return rtrim($valueStr, ',');//去除字符串最后的','
    }
}

if (!function_exists('passwordEncode')) {
    function passwordEncode($password)
    {
//        $password .= "qifengvergood";
        return password_hash($password, PASSWORD_DEFAULT);
    }
}
if (!function_exists('passwordVerify')) {
    function passwordVerify($password, $oldPassword)
    {
//        $password .= "qifengvergood";
        $result = password_verify($password, $oldPassword);
        app('log')->debug('function password：' . $result);
        return $result;
    }
}